package com.peihongli.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component("student")
public class SpringStudent {
    @Value("1")
    private String id;
    @Value("王五五")
    private String name;
    @PostConstruct
    public void init(){
        System.out.println("Bean初始化完成");
    }
    @PreDestroy
    public void destory(){
        System.out.println("Bean销毁前调用");
    }
}
